package searchAlgs;

import Graph.Graph;
import Graph.Vertex;
import java.util.Map;

/**
 *
 * @author Tiago, Ruan
 */
public class Path {

    public void printPath(Graph g,Vertex s,Vertex v,Map<Integer,Vertex>precursor){
        if(s==v){
            System.out.println(s.getId());
        }else{
            if(precursor.get(v.getId()) == null){
                System.out.println("Não existe caminho de s para v");
            }else{
                System.out.print(v.getId()+"<-");
                printPath(g,s,precursor.get(v.getId()),precursor);
            }
        }
    }
}